using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Park.Net.IRepository
{
    public interface IBaseRepository<TEntity> where TEntity :class,new()
    {
        public Task<bool> CreateAsync (TEntity entity);

        public Task<bool> UpdateAsync (TEntity entity);

        public Task<bool> DeleteAsync (TEntity entity);

        public Task<TEntity>  FindOneAsync (int id);

        public Task<TEntity> FindOneAsync( Expression<Func<TEntity, bool>> exp);

        public Task<List<TEntity>> FindManyAsync( Expression <Func<TEntity, bool>> exp);

        public Task<List<TEntity>> FindAllAsync ();
    }
}